package de.hdu.pms.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author BBV
 * 
 *         model class Mitarbeiter
 */

@Entity
@Table(name = "mitarbeiter")
public class Mitarbeiter {

	/**
	 * primary key:
	 * <ul>
	 * <li>mit_id in the database</li>
	 * <li>automatic generated value</li>
	 * </ul>
	 */
	@Id
	@GeneratedValue
	@Column(name = "mit_id")
	private Integer id;

	private String mit_name;
	private String mit_vorname;
	private Integer mit_urlaub; // Urlaubstage Mitarbeiter
	private Boolean mit_isadmin; // Mitarbeiter als Administrator anlegen
	private Integer mit_sollstunden;
	private String mit_login;
	private String mit_pw;

	/**
	 * <b>connection to the table Basis:</b>
	 * <ul>
	 * <li>Bais 1:n Mitarbeiter</li>
	 * <li>one Bais has no, one ore more Mitarbeiter</li>
	 * <li>one Mitarbeiter has one Basis</li>
	 * <li>basis_id is foreign key and referential integrity is on</li>
	 * </ul>
	 */
	@ManyToOne
	@JoinColumn(name = "basis_id", nullable = false)
	private Basis basis;

	public Integer getId() {
		return id;
	}

	public void setId(Integer mit_id) {
		this.id = mit_id;
	}

	public String getMit_name() {
		return mit_name;
	}

	public void setMit_name(String mit_name) {
		this.mit_name = mit_name;
	}

	public String getMit_vorname() {
		return mit_vorname;
	}

	public void setMit_vorname(String mit_vorname) {
		this.mit_vorname = mit_vorname;
	}

	public Integer getMit_urlaub() {
		return mit_urlaub;
	}

	public void setMit_urlaub(Integer mit_urlaub) {
		this.mit_urlaub = mit_urlaub;
	}

	public Boolean getMit_isadmin() {
		return mit_isadmin;
	}

	public void setMit_isadmin(Boolean mit_isadmin) {
		this.mit_isadmin = mit_isadmin;
	}

	public String getMit_login() {
		return mit_login;
	}

	public void setMit_login(String mit_login) {
		this.mit_login = mit_login;
	}

	public String getMit_pw() {
		return mit_pw;
	}

	public void setMit_pw(String mit_pw) {
		this.mit_pw = mit_pw;
	}

	public Integer getMit_sollstunden() {
		return mit_sollstunden;
	}

	public void setMit_sollstunden(Integer mit_sollstunden) {
		this.mit_sollstunden = mit_sollstunden;
	}

	public Basis getBasis() {
		return basis;
	}

	public void setBasis(Basis basis) {
		this.basis = basis;
	}

}
